
#include "main.h"
#include "test.h"


class Test_Misc : public Test
{
	public:

	Test_Misc() {}

	void check()
	{
		minimal_0000();
		check_nan_0000();
	}

	void users()
	{
		users_nan_0000();
	}
	void bench() {}
	

	protected:

	void minimal_0000()
	{
		Minimal<real> m;
		m &= 3;
		m &= -5;
		m &= 7;
		CHECKREAL(-5,m);
	}

	void users_nan_0000()
	{
		printf("# ");
		real x = NaN;
		LOOP(size_t,j,sizeof(x))
			printf("%02X ",((const unsigned char*)(&x))[j]);
		puts("");
	}

	void check_nan_0000()
	{
		const real n = NaN;
		CHECKBOOL(false,finite(n));
		CHECKBOOL(false,finite(-n));

	}
};

REGTEST(Test_Misc)
